package com.hsxshop.dao;

import com.hsxshop.model.Pagination;

import java.util.List;
import java.util.Map;

/**
 * Created by wangchongya on 17/5/8.
 */
public interface BaseDao <T>{

    public int saveEntity(T t);
    public void updateEntity(T t);
    public void saveOrUpdateEntity(T t);
    public void deleteEntity(T t);
    public T getEntity(Integer id);
    public T getEntity(String hql, Object... objects);
    /** 按照HQl **/
    public Map getMapByHQL(String hql, Object... objects);
    public List<Map> getListMapByHQL(String hql, Object... objects);
    /** 注意FROM 必须为大写 **/
    public List<Map> getListMapByHQL(Pagination pagination,String hql, Object... objects);
    public List<T> findByHQL(String hql, Object... objects);
    public boolean exitsByHQL(String hql, Object... objects);

    public int execHQL(String hql, Object... objects);
    public int getRowsCountByHQL(String hql, Object... objects);
    public List<T> findByHQLWithPagination(Pagination pagination, String hql, Object... objects);
}
